<!DOCTYPE html>
<html>
<head>
    <title>科目表</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <i-col span="4">
                <i-select v-model="q.typeId"  placeholder="科目类型选择">
                    <i-option v-for="item in subjectTypeList" :value="item.code"
                              :key="item.code">{{item.value}}
                    </i-option>
                </i-select>
            </i-col>
            <i-col span="4" style="margin-left: 10px">
                <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
            </i-col>
            <i-button class="btn btn-primary" @click="query">查询</i-button>
            <div style="display: block;float: right">
			<#if shiro.hasPermission("lanling:subject:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("lanling:subject:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("lanling:subject:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
            </div>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <i-form ref="formValidate" :model="subject" :rules="ruleValidate" :label-width="80" class="form-horizontal">
            <Form-item label="题库类别" prop="type">
                <i-select v-model="subject.type"  label-in-value placeholder="请选择题库类别" @on-change="getAllSubjectList">
                    <i-option v-for="item in subjectTypeList" :value="item.code" :key="item.code">{{item.value}}
                    </i-option>
                </i-select>
            </Form-item>
            <Form-item label="题库范畴" prop="subjectName">
                <!--<i-input v-model="subject.allSubjectId" placeholder="题库名称"/>-->
                <i-select v-model="subject.allSubjectId"  label-in-value placeholder="请选择题库范畴">
                    <i-option v-for="item in allSubjectList" :value="item.id"
                              :key="item.id">{{item.subjectName}}
                    </i-option>
                </i-select>
            </Form-item>
            <!--<Form-item label="题库logo" prop="logoImg">-->
                <!--<i-col span="16">-->
                    <!--<i-input v-model="subject.logoImg" placeholder="题库logo" readonly/>-->
                <!--</i-col>-->
                <!--<i-col span="3">-->
                    <!--<Form-item :label-width="1">-->
                        <!--<Upload style="width: 300px;" action="../../sys/oss/upload" :format="['jpg','jpeg','png']"-->
                                <!--max-size="2048"-->
                                <!--:on-success="handleSuccessPicUrl" :on-format-error="handleFormatError"-->
                                <!--:show-upload-list="false"-->
                                <!--:on-exceeded-size="handleMaxSize">-->
                            <!--<i-button icon="ios-cloud-upload-outline">上传图片</i-button>-->
                        <!--</Upload>-->
                    <!--</Form-item>-->
                <!--</i-col>-->
                <!--<i-col span="3">-->
                    <!--<Form-item :label-width="1">-->
                        <!--<i-button icon="eye" @click="eyeImagePicUrl">预览图片</i-button>-->
                    <!--</Form-item>-->
                <!--</i-col>-->
            <!--</Form-item>-->
            <Form-item label="题库名称" prop="subjectName">
                <i-input v-model="subject.subjectName" placeholder="题库名称"/>
            </Form-item>
            <!--<Form-item label="排序序号" prop="sortOrder">-->
                <!--<Input-number style="width: 188px;" v-model="subject.sortOrder" placeholder="序号越大,排序越前"/>-->
            <!--</Form-item>-->
            <!--<Form-item label="证件名称" prop="certificatesName">-->
                <!--<i-input v-model="subject.certificatesName" placeholder="证件名称"/>-->
            <!--</Form-item>-->

            <Form-item label="允许考试次数" prop="validCount">
                <Input-number style="width: 188px;" :min="0" v-model="subject.validCount" placeholder="允许考试次数"/>
            </Form-item>
            <Form-item label="及格分数" prop="passscore">
                <Input-number style="width: 188px;" :min="0" type="number" v-model="subject.passscore"
                              placeholder="及格分数"/>
            </Form-item>
            <!--<Form-item label="创建人" prop="createBy">-->
                <!--<i-input v-model="subject.createBy" placeholder="您的姓名"/>-->
            <!--</Form-item>-->
            <Form-item label="备注" prop="remark">
                <i-input v-model="subject.remark" placeholder="备注"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
            </Form-item>
        </i-form>
    </div>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/lanling/subject.js?_${.now?long}"></script>
</body>
</html>